import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';

import {HttpService} from "../../../providers/HttpService";
import {NativeServiceC} from "../../../providers/NativeServiceC";

@IonicPage()
@Component({
  selector: 'page-top',
  templateUrl: 'top.html',
})
export class TopPage {

  topList=[];
  private topUrl:string = '/ranking/gender';
  constructor(
      public navCtrl: NavController,
      public httpService: HttpService,
      public nativeService: NativeServiceC,
      public navParams: NavParams
  ) {
  }

  ionViewDidLoad() {
    // this.nativeService.showToast('hahahah');  //提示
    this.httpService.get(this.topUrl).subscribe(res=>{
      this.topList=res;
      this.nativeService.hideLoading();
    })
  }

  //点击跳转下一页
  private skipNextPage (obj){
    console.log(obj);
    this.navCtrl.push('topDetailPage',{data:obj});
  }

}
